package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the BIG_OFFICE database table.
 * 
 */
@Entity
@Table(name="BIG_OFFICE")
@NamedQuery(name="BigOffice.findAll", query="SELECT b FROM BigOffice b")
public class BigOffice implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="BIG_OFFICE_ID")
	private long bigOfficeId;

	private String name;

	//bi-directional many-to-one association to SmallOffice
	@OneToMany(mappedBy="bigOffice")
	private List<SmallOffice> smallOffices;

	public BigOffice() {
	}

	public long getBigOfficeId() {
		return this.bigOfficeId;
	}

	public void setBigOfficeId(long bigOfficeId) {
		this.bigOfficeId = bigOfficeId;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<SmallOffice> getSmallOffices() {
		return this.smallOffices;
	}

	public void setSmallOffices(List<SmallOffice> smallOffices) {
		this.smallOffices = smallOffices;
	}

	public SmallOffice addSmallOffice(SmallOffice smallOffice) {
		getSmallOffices().add(smallOffice);
		smallOffice.setBigOffice(this);

		return smallOffice;
	}

	public SmallOffice removeSmallOffice(SmallOffice smallOffice) {
		getSmallOffices().remove(smallOffice);
		smallOffice.setBigOffice(null);

		return smallOffice;
	}

}